<?php
// +----------------------------------------------------------------------
// | Copyright (c) 2017~2023 https://www.gxgyl.com All rights reserved.

// +----------------------------------------------------------------------
// | Author: Liuyu
// +----------------------------------------------------------------------
declare (strict_types = 1);

namespace app\api\controller\shiyao;

use app\api\controller\Controller;
use app\api\service\User as UserService;
use cores\exception\BaseException;
use think\response\Json;

/**
 * 管理
 * Class
 * @package app\api\controller
 */
class Auth extends Controller {

	/**
	 * 列表
	 * @return Json
	 * @throws BaseException
	 * @throws \think\db\exception\DataNotFoundException
	 * @throws \think\db\exception\DbException
	 * @throws \think\db\exception\ModelNotFoundException
	 */
	public function info(): Json {
		$user = UserService::getCurrentLoginUser(true);
		$role = json_decode($user['role'], true);
		$role = $role ? $role : [];
		$auth = [];
		if (in_array(10009, $role) || in_array(10006, $role)) {
			$auth['can_add_center'] = 1;
		}
		

		return $this->renderSuccess(compact('auth'));
	}

}